package com.wht.mapper.music.impl;

import com.wht.mapper.music.DeleteMusicDao;
import com.wht.utils.JDBCUtils;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author wanghaotian
 * time:2022/11/21,0021 21:48
 * description:
 */

public class DeleteMusicDaoImpl implements DeleteMusicDao {
    private JdbcTemplate jt = new JdbcTemplate(JDBCUtils.getDs());
    @Override
    public int deleteMusicById(String mid) {
        try {
            String sql = "delete from music where mid=? ";
            int update = jt.update(sql, mid);
            return update;
        } catch (DataAccessException e) {
            return 0;
        }
    }
}
